#include "gui.h"
#include <iostream>



GUIManager::GUIManager()
{
   std::cout<<"GUI Manager started up\n";
}
void GUIManager::UpdateGUI(irr::IrrlichtDevice* pDevG, const c8 *whattochange, const c8 *changeto)
{
   std::cout<<"GUI Manager updated\n";
   gDevice = pDevG;
   
    scene::ISceneNode* node = gDevice->getSceneManager()->addCubeSceneNode();

    node->setMaterialFlag(video::EMF_LIGHTING, false);
    node->setMaterialFlag(video::EMF_WIREFRAME, true);

    // Load GUI
    gui::SImageGUISkinConfig guicfg = LoadGUISkinFromFile(gDevice->getFileSystem(), gDevice->getVideoDriver(), "gui/ui/guiskin.cfg");
    gui::CImageGUISkin* skin = new gui::CImageGUISkin(gDevice->getVideoDriver(), gDevice->getGUIEnvironment()->getSkin());
    skin->loadConfig(guicfg);

    gui::IGUIFont* font = gDevice->getGUIEnvironment()->getFont("gui/ui/fontlucida.png");
    if (font != 0)
		skin->setFont(font, gui::EGDF_DEFAULT);

    gDevice->getGUIEnvironment()->setSkin(skin);

    skin->drop();

//replace with switch later
if (whattochange == "score") {



    gui::IGUIWindow* win = gDevice->getGUIEnvironment()->addWindow(core::rect<s32>(0,0,300,50), false, L"YOUR SCORE!");
   //gDevice->getGUIEnvironment()->addButton( core::rect<s32>(10,10,100,100), 0, -1, L"Button!" );
   //gDevice->getGUIEnvironment()->addCheckBox(true, core::rect<s32>(10,30,30,50), win );
    gDevice->getGUIEnvironment()->addStaticText(L"PaintBalls collected: 0", core::rect<s32>(20, 30, 500, 100), false, false, win);
    //gDevice->getGUIEnvironment()->addStaticText(L"People fed: ", core::rect<s32>(3, 3, 20, 20), false, false, win);
    //gDevice->getGUIEnvironment()->addEditBox(L"Edit box", core::rect<s32>(120,120,400,150) );
}

}


